<template>
  <a-sub-menu v-if="!menu.hidden" :key="menu.path">
    <template #title>
      <i v-if="menu?.meta?.icon" class="iconfont" :class="menu.meta.icon"></i>
      <span>{{ menu && menu.title }}</span>
    </template>
    <template v-for="item in menu.children" :key="item.key">
      <a-menu-item v-if="!item.children && !item.hidden" :key="item.path">
        <span>{{ item && item.title }}</span>
      </a-menu-item>
      <sub-menu v-else :menu="item" />
    </template>
  </a-sub-menu>
</template>
<script setup>
import SubMenu from "./subMenu.vue";
/**
 * props
 */
const props = defineProps({
  menu: {
    type: Object,
    default: () => ({}),
  },
});
</script>
